<div class="content_info">
<form name="frmSearch" id="frmSearch" action="<?php echo BASE_URL_CLUB.'/admin' ?>" method ="POST" enctype="multipart/form-data">
    <table class="list_info">
        <tbody>
            <tr>
                <td style="border:none;">
                    Thể loại:                    
                    <select id="CategoryID" name="categoryid" class="cp_chon">
                        <option value="3">Tất cả</option>
                        <option value="0" <?php if($this->arrSearch['categoryid'] == 0) echo 'selected'; ?>>Bài dự thi</option>
                        <option value="1" <?php if($this->arrSearch['categoryid'] == 1) echo 'selected'; ?>>Đội bóng</option>
                        <option value="2" <?php if($this->arrSearch['categoryid'] == 2) echo 'selected'; ?>>Lịch sử euro</option>
                    </select>
                    Status:
                    <select class="cp_chon" name="status">
                        <option value="0">Tất cả</option>
                        <option value="1" <?php if($this->arrSearch['status'] == 1) echo 'selected'; ?>>Active</option>
                        <option value="2" <?php if($this->arrSearch['status'] == 2) echo 'selected'; ?>>Inactive</option>
                    </select>
                </td>                
            </tr>
            <tr>
                <td style="border:none;">
                    <div class="btn">
                        <input type="submit" id="btnSearch" value="Tìm kiếm">
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
<?php if($this->total > 0)
{?>

<?php echo $this->pagingHTML ?>
    <div class="clear"></div>
    <table class="list_info">
        <tbody>
            <tr>
                <th width="3%">ID</th>
                <th width="25%">Tiêu đề</th>
                <th width="10%">Thể loại</th>
                <th width="8%">Status</th>
                <th width="10%">Ngày tạo</th>
                <th width="14%">Họ tên</th>
                <th width="17%">Email</th>
                <th width="13%">Tùy chọn</th>
            </tr>
             <?php
            $arrStatus = array(1=>'Active',2=>'Inactive');
            $arrArticleStatus = array(1=>'Active',2=>'Inactive',0=>'Deleted');
            $arrCategory = array(0=>'Bài dự thi',1=>'Đội bóng',2=>'Lịch sử euro');
            foreach ( $this->arrData as $key=>$value )
            {
                if ( in_array($value['articleid'], $this->listHotID) )
                {
                    $set = 1;
                }
                else
                {
                    $set = 0;
                }//end if
            ?>
            <tr>
            <?php if($value['status'] != 3)
                {
            ?>
                <td class="infor" width="3%"><?php echo $value['articleid'] ?></td>
                <td class="tieu_de infor" width="25%" style="color:#476DA4;"><a href="<?php echo BASE_URL_CLUB.'/admin/detail/id/'.$value['articleid'];?>" title="Nhấn vào đây để xem chi tiết"><?php echo $value['title'];?></a></td>
                <td class="infor" width="10%"><?php if($value['categoryid'] != NULL){  echo $arrCategory[$value['categoryid']];} ?></td>
                <td class="infor" width="8%" style="color:#476DA4;"><?php echo $arrArticleStatus[$value['status']]; ?></td>
                <td class="infor" width="10%"><?php echo date('d-m-Y', $value['creation_time']);?></td>
                <td class="infor" width="14%"><?php echo $this->listUserInfo[$value['userid']]['fullname'];?></td>
                <td class="infor" width="17%">
                <?php
                    if ( !empty($this->listUserInfo[$value['userid']]['email']) )
                    {
                ?>
                    <a href="mailto:<?php echo $this->listUserInfo[$value['userid']]['email'];?>"><?php echo $this->listUserInfo[$value['userid']]['email'];?></a>
                <?php
                    }//end if
                ?>
                </td>
                <td class="infor" width="13%">
                    <a href="<?php echo BASE_URL_CLUB.'/admin/update/id/'.$value['articleid'];?>">Edit</a>
                    |
                    <a href="<?php echo BASE_URL_CLUB.'/admin/deletearticle/id/'.$value['articleid'];?>" onclick="return confirm('Are you sure to delete?')">Delete</a>
                    <br>
                    <a href="<?php echo BASE_URL_CLUB.'/admin/updatestatus/id/'.$value['articleid'].'/status/'.$value['status'];?>"><?php echo ($value['status']==1)?'Inactive':'Active';?></a>
                <?php if ( $value['categoryid']!=2 && $value['status']==1 && !$set ) {?>
                    |
                    <a href="<?php echo BASE_URL_CLUB.'/admin/sethot/id/'.$value['articleid'];?>">Set Hot</a>
                <?php }//end if?>
                <?php if ( $value['categoryid']!=2 && $value['status']==1 && $set ) {?>
                    |
                    <a href="<?php echo BASE_URL_CLUB.'/admin/unsetsethot/id/'.$value['articleid'];?>">Unset Hot</a>
                <?php }//end if?>
                </td>
            <?php
                }//end if
            ?>
            </tr>
            <?php
            } //End for
            ?>
        </tbody>
    </table>
    <div class="total_item">
        Có tổng cộng <b><?php echo $this->total;?></b> mẫu tin
    </div>
    <?php echo $this->pagingHTML ?>
<?php } //End If    
    else
    {?>
    <div class="total_item" style="width: 500px;">
        <b>Không tìm thấy mẫu tin nào</b>
    </div>
    <?php
    }
    ?>
</form>
</div>

